

<!doctype html>
<html ng-app>
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body>
<div class="example2" ng-controller="Cntl1">
    Name: <input ng-model="name" type="text"/>
    <button ng-click="greet()">Greet</button>
</div>
</body>
<script type="text/javascript">
    function Cntl1($window, $scope){
        $scope.name = 'World';

        $scope.greet = function() {
            ($window.mockWindow || $window).alert('Hello ' + $scope.name);
        }
    }
</script>
</html>

